package golf;

import java.sql.ResultSet;
import java.sql.SQLException;

import database.DAO;

public class ScoreCard {
	int roomNo;
	int charNo;
	int score;
	
	Room room;
	Character character;
	
	public ScoreCard(){}
	public ScoreCard(ResultSet rs){
		DAO dao = DAO.getInstance();
		try {
			setRoomNo(rs.getInt("ROOMNO"));
			setCharNo(rs.getInt("CHARNO"));
			setScore(rs.getInt("SCORE"));
			
			setRoom(dao.getRoom(getRoomNo()));
			setCharacter(dao.getCharacter(getCharNo()));
			
			System.out.println("ScoreCard() 생성자 완료");
		} catch (SQLException e) {
			System.out.println("ScoreCard() 실패");
			e.printStackTrace();
		}
	}
	
	
	public int getRoomNo() {
		return roomNo;
	}
	public void setRoomNo(int roomNo) {
		this.roomNo = roomNo;
	}
	public int getCharNo() {
		return charNo;
	}
	public void setCharNo(int charNo) {
		this.charNo = charNo;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	public Character getCharacter() {
		return character;
	}
	public void setCharacter(Character character) {
		this.character = character;
	}
	
	
}
